<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加</title>
    <#assign base=request.contextPath  />
    <base id="base" href="${base}">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, adminUser-scalable=0">
    <link rel="stylesheet" href="${base}/static/win10/component/layui/css/layui.css" media="all">
    <script>
        var base =  "${base}";
    </script>
</head>
<body>
<br>
<form class="layui-form " action="">
         <input type="hidden" id="educationId" name="educationId" value="${wechatEducation.educationId!}" >
          <div class="layui-form-item">
              <label class="layui-form-label">学校名字</label>
              <div class="layui-input-block">
                  <input type="text" id="educationSchool" name="educationSchool" value="${wechatEducation.educationSchool!}"  autocomplete="off" placeholder="请输入学校名字"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">入学时间</label>
              <div class="layui-input-block">
                  <input type="text" id="educationStartTime" name="educationStartTime" value="${wechatEducation.educationStartTime!}"  autocomplete="off" placeholder="请输入入学时间"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">毕业时间</label>
              <div class="layui-input-block">
                  <input type="text" id="educationEndTime" name="educationEndTime" value="${wechatEducation.educationEndTime!}"  autocomplete="off" placeholder="请输入毕业时间"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">学历ID</label>
              <div class="layui-input-block">
                  <input type="text" id="educationLabelId" name="educationLabelId" value="${wechatEducation.educationLabelId!}"  autocomplete="off" placeholder="请输入学历ID"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">专业ID</label>
              <div class="layui-input-block">
                  <input type="text" id="educationMajorId" name="educationMajorId" value="${wechatEducation.educationMajorId!}"  autocomplete="off" placeholder="请输入专业ID"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">创建时间</label>
              <div class="layui-input-block">
                  <input type="text" id="educationCreateTime" name="educationCreateTime" value="${wechatEducation.educationCreateTime!}"  autocomplete="off" placeholder="请输入创建时间"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">修改时间</label>
              <div class="layui-input-block">
                  <input type="text" id="educationUpdateTime" name="educationUpdateTime" value="${wechatEducation.educationUpdateTime!}"  autocomplete="off" placeholder="请输入修改时间"
                         class="layui-input">
              </div>
          </div>

    <div align="center">
        <button type="button" class="layui-btn" id="submit">保存</button>
    </div>
</form>

<script src="${base}/static/win10/component/layui/layui.js?t=1"></script>
<script src="${base}/static/win10/js/jquery-1.8.3.min.js?t=1"></script>
<script>
    layui.use(['form', 'layer'], function() {
        var form = layui.form
                , layer = layui.layer;
        $("#submit").on("click",function () {
            if(check()===false){
                return;
            }

            var formDate = {
                         educationId:$("#educationId").val(),
                         educationSchool:$("#educationSchool").val(),
                         educationStartTime:$("#educationStartTime").val(),
                         educationEndTime:$("#educationEndTime").val(),
                         educationLabelId:$("#educationLabelId").val(),
                         educationMajorId:$("#educationMajorId").val(),
                         educationCreateTime:$("#educationCreateTime").val(),
                           educationUpdateTime:$("#educationUpdateTime").val()
            }
            $.ajax({
                type: "POST",
                url: base+"/WeChatUser/wechatEducation/admin/editWechatEducation",
                data: formDate,
                success: function (data) {
                    layer.msg(data.message)
                    if (data.code === 200) {
                        window.location.href=base+"/WeChatUser/wechatEducation/admin/main.html"
                    } else {

                    }
                }
            });
        })







        function check(){
                   if($("#educationSchool").val().length<1){
                       layer.msg("请输入学校名字");
                       return false;
                   }
                   if($("#educationStartTime").val().length<1){
                       layer.msg("请输入入学时间");
                       return false;
                   }
                   if($("#educationEndTime").val().length<1){
                       layer.msg("请输入毕业时间");
                       return false;
                   }
                   if($("#educationLabelId").val().length<1){
                       layer.msg("请输入学历ID");
                       return false;
                   }
                   if($("#educationMajorId").val().length<1){
                       layer.msg("请输入专业ID");
                       return false;
                   }
                   if($("#educationCreateTime").val().length<1){
                       layer.msg("请输入创建时间");
                       return false;
                   }
                   if($("#educationUpdateTime").val().length<1){
                       layer.msg("请输入修改时间");
                       return false;
                   }
        }
    });

</script>
</body>
</html>